package com.baidu.ai.aip;

import com.baidu.ai.aip.faceDatabase.FaceAdd;
import com.baidu.ai.aip.utils.Base64Util;
import com.baidu.ai.aip.utils.FileUtil;

import java.io.IOException;

public class BaiduFaceClass implements BaiduApiImp {



    @Override
    public int add(String imgUrl, String groupId, String userId, String userInfo) throws IOException {
        // 图片转为字节
        byte[] imgData = FileUtil.readFileByBytes(imgUrl);
        // 字节转为Base64编码
        String image = Base64Util.encode(imgData);

        String reSignal =  FaceAdd.add(image,groupId,userId,userInfo);
        return 0;
    }

    @Override
    public int delete(int userId) {
        return 0;
    }

    @Override
    public int search(String imgUrl) {
        return 0;
    }
}
